﻿//获取经验页地址及拼接参数
var locathref=location.href;
var eid=location.href.match(/eid=[0-9]+/)[0];
$.cookie("eid",eid);

var haveMyid=true;//是否有cookie.MYID 用于所有事件点击
var pageSize=10;
var currentIndex=1;

//评论弹出框
var findhelp=document.getElementById("findhelp"); //寻求帮助按钮
var formone=document.getElementsByClassName("formone")[0]; //寻求帮助弹出框
var formtwo=document.getElementsByClassName("formtwo")[0];
var modalbg=document.getElementsByClassName("modal_bg2")[0];
var modal=document.getElementsByClassName("action_menu_container2")[0];
var cancel=document.getElementsByClassName("cancel");
var timer;
for(var i=0;i<cancel.length;i++){
    if(haveMyid){
        cancel[i].onclick=function(){
            if(modalbg.style.display=="block"&&modal.style.display=="block"){
                modalbg.className+=' animate_out';
                modal.className+=' animate_out';
            }
            timer=setTimeout(changeclass,100);
        };
    }
}
function changeclass(){
    modalbg.className='modal_bg modal_bg2';
    modal.className='action_menu_container action_menu_container2';
    clearTimeout();
    timer=null;
    changedisplay();
};
function changedisplay(){
    modalbg.style.display="none";
    modal.style.display="none";
};
//        弹出收藏转发
var paybtn1=document.getElementById("paybtn1");
var modalbg1=document.getElementsByClassName("modal_bg1")[0];
var modal1=document.getElementsByClassName("action_menu_container1")[0];
var cancel1=document.getElementsByClassName("cancel1")[0];
var timer1;

paybtn1.onclick=function(){
    if(haveMyid){
        modalbg1.style.display="block";
        modal1.style.display="block";
    }

};

cancel1.onclick=function(){
    if(haveMyid){
        if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
            modalbg1.className+=' animate_out';
            modal1.className+=' animate_out';
        }
        timer1=setTimeout(changeclass1,100);
    }
};

function changeclass1(){
    modalbg1.className='modal_bg modal_bg1';
    modal1.className='action_menu_container action_menu_container1';
    clearTimeout();
    timer=null;
    changedisplay1();
};
function changedisplay1(){
    modalbg1.style.display="none";
    modal1.style.display="none";
};
//微信转发
var sharetitle="";//标题
var sharenick="";//昵称
if($.cookie("MYNICK")&&$.cookie("MYNICK")!="undefined"){
    sharenick=$.cookie("MYNICK")+'分享："';
}
var sharekeyword="";//关键词
var sharemoney=0;
var wxType=3;//微信转发类型
function wxshare(){
    //修改转发地址
    //来自分享
    //连接微信  转发
    (function(){
        var eid=(location.href).match(/eid=[0-9]+/)[0].match(/[0-9]+/)[0];

        var fromuser=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];

        $.ajax({
            type:"GET",
            url:"GetSign.ashx?p=weixin/shareexppage.html?eid="+eid+"#fromuser="+fromuser,
            success:function(data){
                timestampone=data.timestamp;
                nonceStrone=data.nonceStr;
                signatureone=data.signature;
                wx.config({
                    debug:false,
                    appId: 'wx658c34793ecfd9f9',
                    timestamp:timestampone, //时间戳
                    nonceStr:nonceStrone,  //随机字符串
                    signature:signatureone,  //SHA1编码
                    jsApiList: [
                        // 所有要调用的 API 都要加到这个列表中
                        "onMenuShareTimeline","onMenuShareAppMessage"
                    ]
                });
            }
        })
    })();
    wx.ready(function(){
        var eid=(location.href).match(/eid=[0-9]+/)[0].match(/[0-9]+/)[0];

        var fromuser=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];

        //var newsurl=newsurl.replace(/http:\/\//,"");
        //微信转发到朋友圈
        wx.onMenuShareTimeline({  //分享标题  昵称      关键词
            title:sharenick+sharetitle+sharekeyword,
            //link:"http://www.pulu.com/weixin/pulunews_share.html?eid="+eid+"#fromuser="+fromuser, // 分享链接
            link:"http://www.pulu.com/weixin/shareexppage.html?eid="+eid+"#fromuser="+fromuser, // 分享链接
            imgUrl:"https://www.pulu.com/weixin/img/puluweixin.jpg", // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
                //增加转发次数
                $.ajax({
                    type:"post",
                    url:addSendWXNumurl,
                    data:{"qid":eid,"qtype":wxType},
                    success:function(){
                        alert("分享成功");
                    }
                })
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
                //alert("取消分享");
            }
        });
//微信转发给好友
        wx.onMenuShareAppMessage({
            title:sharenick+sharetitle+sharekeyword, // 分享标题
            desc: 'Pulu铺路经验，好朋友互相铺路', // 分享描述
            link:"http://www.pulu.com/weixin/shareexppage.html?eid="+eid+"#fromuser="+fromuser, // 分享链接
            //imgUrl:"www.pulu.com/weixin/img/sharepuluimg.jpg", // 分享图标
            imgUrl:"https://www.pulu.com/weixin/img/puluweixin.jpg", // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
                //增加转发次数
                $.ajax({
                    type:"post",
                    url:addSendWXNumurl,
                    data:{"qid":eid,"qtype":wxType},
                    success:function(){
                        alert("分享成功");
                    }
                })
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
                //alert("取消了");
            }
        });
    });
}
//相关经验金钱判断能否进入
function moneytest(e){
    //判断能不能去看详情页
    var thiseid= e.dataset.eid;
    if($.cookie("MYID")){
        location.href='shareexppage.html?eid='+thiseid+"#fromuser="+id;
    }else{
        location.href='shareexppage.html?eid='+thiseid+"#fromuser="+$.cookie("MYID");
    }
}
$("#heightexpno").click(function(){
    if(haveMyid){$("#heightexpdiv").css("display","none");}
});

var upers;//点赞的人 用于点赞判断
var countnum=document.getElementById("countnum");
var goodbtn=document.getElementById("goodbtn");
var isclickgood=0;
//回复评论
function comment(e){
    if($.cookie("MYID")){
        if(e.dataset.uid&&e.dataset.uid!=id){
            var sendeid="";
            var replyname="";
            if(e.dataset.reply){
                sendeid="&reply="+e.dataset.reply;
                replyname="&replyname="+e.dataset.replyname;
            };
            location.href="comment.html?aid="+e.dataset.id+sendeid+replyname;
        }else if(!e.dataset.uid){
            var sendeid="";
            var replyname="";
            if(e.dataset.reply){
                sendeid="&reply="+e.dataset.reply;
            };
            location.href="comment.html?aid="+e.dataset.id+sendeid+replyname;
        }
    }
};

//点击判断
//$.cookie("MYID","");$.cookie("myopenid","");$.cookie("fromuser","");$.cookie("haschanged","");
//if($.cookie("myopenid")){
//    alert("openid:"+$.cookie("myopenid"));
//}

if(!$.cookie("MYID")){
    $("#getmpay").css("display","block");
    //alert("meiyou cookie userid");
    haveMyid=false;
    document.onclick=function(){
        var newid=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];
        location.href="http://www.pulu.com/weixin/index.html?"+$.cookie("eid")+"#fromuser="+newid;
    }
}
//二维码关注骚扰弹框
// else{
//     if(is_weixn()){
//         $.ajax({
//             type:"get",
//             url:harassurl+$.cookie("MYID"),
//             success:function(d){
//                 //console.log(d);
//                 //没有关注
//                 if(!d.Data){
//                     $("#harass").css("display","block");
//                 }
//             }
//         });
//     }
// }
$("#closeharass").click(function(){
    $("#harass").css("display","none");
});
$("#closeharass1").click(function(){
    if($.cookie("MYID")){
        $.ajax({
            type:"post",
            url:changeqrurl,
            data:{"userId":$.cookie("MYID")},
            success:function(d){
                $("#harass").css("display","none");
            }
        })
    }
    else{
        $("#harass").css("display","none");
    }
});
//else{alert("you:"+ $.cookie("MYID"))}
//console.log("当前经验拼接数据："+eid);
//查看者信息用于假数据
var mynick="",myimg="",mysig="";
var money=0;
var euserid="";//发布者id
//点击输入框动画参数
var allheihgt=230;
var stepleng=allheihgt/10;
//--------------------------------------
var exptitle;//经验标题 用于分享
var myimg;
if($.cookie("MYAVA")&&$.cookie("MYAVA")!="null"){
    //console.log($.cookie("MYAVA"));
    myimg="<img class='profile_photo_img' src='http://42.62.66.198:8003/"+$.cookie("MYAVA")+"'>";
}else{
    myimg="<img class='profile_photo_img' src='../img/af8.png'>";
}
//var myimg="<img class='profile_photo_img' src='http://42.62.66.198:8003/"+$.cookie("MYAVA")+"'>";
var starhash={
    "1":"写的不错",
    "2":"受教了",
    "3":"豁然开朗",
    "4":"经验很有用",
    "5":"受益匪浅",
    "6":"感谢分享",
    "7":"普普通通",
    "8":"被坑了",
    "9":"写的一般",
    "10":"废话太多",
    "11":"然而并没有用",
    "12":"白花钱了"
};
//展示加载图片
function showloadimg(e){
    $(e).fadeIn();
}
function contentshowloadimg(e){
    $(e).css("opacity","1");
}
//跳转他人详情页
function usergohref(i){
    if($.cookie("MYID")){
        var userReg=new RegExp($.cookie("MYID"));
        if(userReg.test(i.dataset.href)){
            location.href="setpage.html";
        }else{
            location.href= i.dataset.href;
        }
    }
}
////全部回答者中标签
//function allanswerlabel(){
//    //更新标签接口
//    $.ajax({
//        type:"get",
//        url:"https://www.pulu.com/webapi/api/puluquestion/GetStarScoreById_e?questionId="+eid,
//        success:function(data){
//            console.log(data);
//            ////评星
//            //var starlen=0;
//            //if(data.Data.StarScore!==0){
//            //    var strnum=(data.Data.StarScore).toString();
//            //    if(strnum.length===3){
//            //        var lastnum=parseFloat(strnum.substring(strnum.length-1));
//            //        //尾数在4~6之间
//            //        if(lastnum>=4&&lastnum<=6){
//            //            starlen=strnum.substring(strnum.length-1,0)+5;
//            //        }else if(lastnum<4){
//            //            starlen=strnum.substring(0,1);
//            //        }else if(lastnum>6){
//            //            starlen=parseFloat(strnum.substring(0,1))+1;
//            //        }
//            //    }else{
//            //        starlen=data.Data.StarScore;
//            //    }
//            //}
//            //$("#detailstar #expstar").css("width",parseFloat(starlen)*20+"%");
//            if(data.Data.exStarList.length==0){
//                $("#allanswer .mainbody .allnoticebox").css("display","none");
//            }else{
//                $("#allanswer .mainbody .allnoticebox").css("display","block");
//            }
//            for(var a=0;a<data.Data.exStarList.length;a++){
//                $("#allanswer .noticebox").append("<div class='item'>"+starhash[data.Data.exStarList[a].labelId]+"("+data.Data.exStarList[a].count+")</div>");
//            }
//        }
//    });
//}

//获取回答
var cangetanswerurl="yes";//滚动加载
function getanswer(pageSize,page){
    if(/^\d+$/.test(eid)){

    }else{
        eid=eid.split("=")[1];
    }
    //获得回答
    $.ajax({
        type:"get",
        url:getexpcomurl+eid+"&pageSize="+pageSize+"&currentIndex="+currentIndex+"&userId="+id,
        datatype:"json",
        success:function(data){

            if(data.Data){
                dd=data.Data.commentList;
            }else{
                dd="";
            }
            if(dd&&dd.length>0){
                $("#QuestionMain").css("display","block");
                $("#noticeevalu").css("display","block");
                //$("#noticeevalu .noticebox").css("display","block");
                for(var l=0;l<dd.length;l++){
                    var htmlword="";//保存图片代码段
                    var tim="";//保存时间
                    //真名
                    var thisRealName="";
                    if(dd[l].realName){thisRealName=" ("+dd[l].realName+")"};
                    //获得时间
                    if(dd[l].cTime){
                        tim=getDateDiff(getDateTimeStamp(dd[l].cTime));
                    };
                    var headerimg="<a onclick='usergohref(this)' data-href='otherpeoplepage.html?otherid="+dd[l].userId+"'><img class='portrait' src='../img/af8.png'></a>";
                    if(dd[l].userAva){
                        headerimg="<a onclick='usergohref(this)' data-href='otherpeoplepage.html?otherid="+dd[l].userId+"'><img class='portrait' src='http://42.62.66.198:8003/"+dd[l].userAva+"' onload='showloadimg(this)' style='display:none;'></a> ";
                    }
                    var pinglun="<a class='commentbtn' onclick='comment(this)' data-eid='"+eid+"' id='c"+dd[l].answerId+"'></a>";
                    var newcontent=codetoface(dd[l].content);//回复文字中插入表情图片
                    if(tim){}else{tim="刚刚"};
                    //点赞
                    var upers="";
                    var upstylecode="";
                    if(dd[l].upUsers&&dd[l].upUsers.length>0){
                        goodnum=dd[l].upUsers;
                        displayword="-webkit-box;border-top: 1px solid #EDEDED;";
                        chatcssword="";
                        for(var lu=0;lu<dd[l].upUsers.length;lu++){
                            dd[l].upUsers[lu].index=lu;
                            if(dd[l].upUsers[lu].upUserId===id){isclick=" isclicked";}
                            upers+="<span class='heartspan' data-uid='"+dd[l].upUsers[lu].upUserId+"'>"+dd[l].upUsers[lu].upUserNick+"</span>";
                        }
                    }else{
                        upstylecode="style='display:none;'";
                    }
                    //二级评论
                    var secondword="";
                    if(dd[l].commentList&&dd[l].commentList.length>0){
                        for(var r1=0;r1<dd[l].commentList.length;r1++){
                            var replyto="";
                            if(dd[l].commentList[r1].replyToUserNick){
                                replyto=" <b>回复</b> "+dd[l].commentList[r1].replyToUserNick;
                            }
                            // data-replyname='"+dd[l].commentList[r1].userNick+"' data-reply='"+dd[l].commentList[r1].commentId+"' data-eid='"+eid+"' onclick='comment(this)'
                            var secondfaceword=codetoface(dd[l].commentList[r1].content);
                            secondword+="<div id='second"+dd[l].commentList[r1].commentId+"' data-replyname='"+dd[l].commentList[r1].userNick+"' data-reply='"+dd[l].commentList[r1].commentId+"' data-eid='"+eid+"' data-uid='"+dd[l].commentList[r1].userId+"' data-id='c"+dd[l].answerId+"' onclick='comment(this)'><span class='username'>"+dd[l].commentList[r1].userNick+replyto+"：</span><span class='userword commentbtn'>"+secondfaceword+"</span></div>";
                        }
                        secondword="<div class='chatplace'><i></i><div class='secondword'>"+secondword+"</div></div>";
                    }
                    //没点赞 没评论 关闭区域
                    var placestyle="";
                    if((!dd[l].upUsers||dd[l].upUsers.length==0)&&(!dd[l].commentList||dd[l].commentList.length==0)){
                        placestyle="style='display:none;'";
                    }
                    //打分
                    var paycode="";
                    //if(dd[l].experienceStar>0){
                    //    paycode="<div class='common-info'><div class='ui-comment-box ui-comment-star5'><span class='star star0'><i style='width:"+parseFloat(dd[l].experienceStar)*20+"%'></i></span></div></div>";
                    //}
                    //已赚取 已支出
                    var secondtitleword="";
                    secondtitleword="已赚取"+parseInt(dd[l].daysin)/100+"元 | 已支出"+parseInt(dd[l].daysout)/100+"元";
                    var pinglun="";
                    pinglun="<a class='commentbtn' id='c"+dd[l].answerId+"' data-uid='"+dd[l].userId+"'></a>";
                    //主页加载两条
                    if(page==="main"){
                        $("#addmoreanswerbtn2").before("<div class='js_tag js_commentP'><div class='common-head-view'><div class='author-logo'>"+headerimg+"</div><div class='author-info'><div class='author-info1'><div class='author js_author' style='max-width: 330px;'>"+dd[l].userNick+thisRealName+"</div></div><div class='author-info2'>"+secondtitleword+"</div></div></div>"+paycode+"<div class='comment-main js_content'><p class='js_comment_desc'>"+newcontent+"</p><div class='hits_zan_box js_hits_zan_box'><div class='left-view'><p class='resource_date'>"+tim+"</p></div><div class='common-iconfont useful js_hits' style='display:none;' data-eid='"+eid+"' data-id='c"+dd[l].answerId+"'><i class='upthumlogo upthumlogo"+dd[l].answerId+"'></i>有用<span class='js_usefull_num'>1</span></div><div class='useful js_hits' onclick='comment(this)' data-eid='"+eid+"' data-id='c"+dd[l].answerId+"'><i></i>回复<span class='js_usefull_num'></span></div></div><div class='common-iconfont zan-person js_zan' "+placestyle+"><div class='up-thumb' "+upstylecode+"><i></i><div class='text'>"+upers+"</div></div>"+secondword+"</div></div></div>");
                    }else if(page==="allanswer"){
                        $("#allanswer .mainbody").append("<div class='js_tag js_commentP'><div class='common-head-view'><div class='author-logo'>"+headerimg+"</div><div class='author-info'><div class='author-info1'><div class='author js_author' style='max-width: 330px;'>"+dd[l].userNick+thisRealName+"</div></div><div class='author-info2'>"+secondtitleword+"</div></div></div>"+paycode+"<div class='comment-main js_content'><p class='js_comment_desc'>"+newcontent+"</p><div class='hits_zan_box js_hits_zan_box'><div class='left-view'><p class='resource_date'>"+tim+"</p></div><div class='common-iconfont useful js_hits' style='display:none;' data-eid='"+eid+"' data-id='c"+dd[l].answerId+"'><i class='upthumlogo upthumlogo"+dd[l].answerId+"'></i>有用<span class='js_usefull_num'>1</span></div><div class='useful js_hits' onclick='comment(this)' data-eid='"+eid+"' data-id='c"+dd[l].answerId+"'><i></i>回复<span class='js_usefull_num'></span></div></div><div class='common-iconfont zan-person js_zan' "+placestyle+"><div class='up-thumb' "+upstylecode+"><i></i><div class='text'>"+upers+"</div></div>"+secondword+"</div></div></div>");
                    }
                }
                htmlword="";
                answerimgs="";
                tim="";
            }
            else{
                if(page==="main"){
                    $("#QuestionMain").css("display","none");
                    $("#addmoreanswerbtn").css("display","none");
                }
                cangetanswerurl="no";
            }
        }
    });
}
//点击查看所有回答所有评论-----------------------------------------------
$("#addmoreanswerbtn").click(function(){
    if(haveMyid){
        currentIndex=1;
        $("#allanswer .mainbody .js_tag.js_commentP").remove();
        //$("#allanswer>.mainbody>.noticebox>.item").remove();
        //allanswerlabel();
        getanswer(pageSize,"allanswer");
        $("#allanswer").css("display","block");
        $(window).scrollTop(0);
        $("#page_wrapper").css("display","none");
        $("#evaluate").css("display","none");
    }
});
$("#addmoreanswerbtn2").click(function(){
    if(haveMyid){
        currentIndex=1;
        $("#allanswer .mainbody .js_tag.js_commentP").remove();
        //$("#allanswer>.mainbody>.noticebox>.item").remove();
        //allanswerlabel();
        getanswer(pageSize,"allanswer");
        $("#allanswer").css("display","block");
        $(window).scrollTop(0);
        $("#page_wrapper").css("display","none");
        $("#evaluate").css("display","none");
    }
});
$("#allanswerbtn").click(function(){
    if(haveMyid){
        $("#allanswer").css("display","none");
        $("#page_wrapper").css("display","block");
        //$("#evaluate").css("display","block");
    }
});

$(window).scroll(function(){
    if($("#allanswer").css("display")==="block"){
        var screenH=window.screen.height;//屏幕高度
        var mainheight=$("#allanswer").height();//加载区内主体高度
        var scrollH=$(window).scrollTop();//加载区内滚动隐藏高度
        console.log(screenH);
        console.log(mainheight);
        console.log(scrollH);
        if((screenH+scrollH+100)>mainheight){
            if(cangetanswerurl==="yes"){
                currentIndex++;
                getanswer(pageSize,"allanswer");
            }
        }
    }
});
var contnetword;
var imgword;
var myscore;//我的账户余额（元）
var isexphei="yes";//是否是高额经验 默认高额; 普通经验直接展示
var canpayexp="no";//能否付费接口 只有能进行付费判断才是yes
var canpayclick=true;//付费按钮只能点击一次
var havemoney="yes";//账户余额是否足够
var convert="no";//是否为问题转换 默认为NO
var expamount;//预期总收益
var convertTitle="";
var convertContent="";
var isH;
var expUID;
var havesendcom=true;//评论 防止多次点击
var upnick=[];//所有点赞者昵称
var upuserid=[];//所有点赞者ID
var typeNum=3;//发布页面、相关经验 默认为经验3 单身4 电影5 工作6 租房7
var redBag=false;//默认没有红包
//查看所有付费者
$("#paynum2").click(function(){
    if($.cookie("MYID")&&($("#paynum2").attr("class")=="canclick")){
        location.href="showallpay.html?eid="+eid;
    }
});
//查看所有点赞者
$(".allupers").click(function(){
    if($.cookie("MYID")){
        location.href="showallpay.html?eid="+eid+"#allup";
    }
});
//查看所有红包领取者
$("#rednum2").click(function(){
    if($.cookie("MYID")&&parseInt($("#rednum").html())>0){
        location.href="showallpay.html?eid="+eid+"#redBag";
    }
});
function gotoother(e){
    if($.cookie("MYID")){
        location.href=e.dataset.href;
    }
}
function IsPC() {
    var userAgentInfo = navigator.userAgent;
    var Agents = ["Android", "iPhone",
        "SymbianOS", "Windows Phone",
        "iPad", "iPod"];
    var flag = true;
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            flag = false;
            break;
        }
    }
    return flag;
};
//发高额
function gotoheiexp(data){
    if($.cookie("MYID")){
        if($.cookie("validateLevel")!=1&&$.cookie("validateLevel")!=2){
            $("#canNotSend").css("display","block");
            $("html").css("overflow-y","hidden");
        }else{
            var eid=data.dataset.keyword;
            if(is_weixn()){
                $.cookie("expkeyword",eid);
                $.cookie("expType","");
                $.cookie("sendque","");
                var expType="";
                if(typeNum==4){expType="?goSingle";}
                else if(typeNum==5){expType="?goFilm";}
                else if(typeNum==6){expType="?goWork";}
                else if(typeNum==7){expType="?goHouse";}
                else if(typeNum==8){expType="?goProgect";}
                else if(typeNum==9){expType="?goRes";}
                else if(typeNum==10){expType="?goOther";}
                location.href="http://www.pulu.com/weixin/sendexpgpc.html"+expType;
            }
            else{
                var expType="";
                if(typeNum==4){expType="&goSingle";}
                else if(typeNum==5){expType="&goFilm";}
                else if(typeNum==6){expType="&goWork";}
                else if(typeNum==7){expType="&goHouse";}
                else if(typeNum==8){expType="?goProgect";}
                else if(typeNum==9){expType="?goRes";}
                else if(typeNum==10){expType="?goOther";}
                location.href="https://www.pulu.com/weixin/sendexpgpc.html?id="+id+"&keyword="+eid+expType;
            }
        }
    }
}
$("#canNotSend .closeBtn").click(function(){
    $("#canNotSend").css("display","none");
    $("html").css("overflow-y","auto");
});
function goAuthenticate(){
    location.href="authenticate.html?goPage=goExp"
}
//展示点赞者
function showuper(nick,id){
    var upnum= nick.length;
    var inum=upnum;
    var lastword="";
    var shownick=[];
    if(upnum>3){inum=3;lastword="等"};
    for(var i=0;i<upnum;i++){
        if(id[i]== $.cookie("MYID")){
            $("#goodbtn").css("backgroundImage","url(img/redheart.png)");

            $("#goodbtn .word").attr("class","word clicked");
        }
        if(i<inum){shownick.push(nick[i]);}
    }
    var allupnick=shownick.join(",")+lastword;
    $("#upnum2").html(allupnick);
    $("#upnum").html(upnum);
    $(".allupers").css("display","block");
}
$(".relaurl a").click(function(){
    if($.cookie("MYID")){
        location.href=$(".relaurl a").html();
    }
});
function goSinglePeople(i){
    console.log(i.dataset.user);
    location.href="otherpeoplepage.html?otherid="+i.dataset.user;
};
$().ready(function(){
    if($.cookie("pexpid")){}
    var reg=/(eid=)([0-9]*)/;
    var eid=urlfrom.match(reg).splice("=")[2];
    var money="";//经验单价
    var allmoney;//总收入
    var allRedBagNum=0;//红包总数 点击抢完显示
    //控制 是否展示全部 来自expfromsharelink.js

    //获取我的账户余额
    if($.cookie("MYID")){
        $.ajax({
            type:"get",
            datatype:"json",
            url:lastscoreurl+id,
            success:function(d){
                //console.log(d);
                myscore=Math.round(d.Data)/100;
                $("#mylastscore").html(myscore);
                $("#mylastscore2").html(myscore);
            }
        });
    };
    //获得经验内容
    var sendid=id;
    if($.cookie("MYID")&&/[0-9]/.test($.cookie("MYID"))){
        sendid=$.cookie("MYID");
    }
    //获取经验详情
    $.ajax({
        type:"get",
        url:getdetialurl+eid+"&userId="+sendid,
        //data:{"questionId":eid},
        datatype: "json",
        success:function(data){
            //经验已被删除
            if(data.Code=="FALSE"){
                $("#showpage").css("display","none");
                $("#sharenews").css("display","none");
                $("#givechat").css("display","none");
                $("#qrcode").css("right","10px");
                $("#delExp").css("display","block");
            }
            else{
                var oriword="我也来说说";
                wxType=data.Data.qtype;//微信转发类型
                if(wxType!=3){$("#showrule").css("display","none")}//资源隐藏转发提醒
                if(data.Data.qtype==3){typeNum=3;$("#typeName").html("经验");}
                else if(data.Data.qtype==4){typeNum=4;oriword="我也来分享单身资源";$("#typeName").html("单身资源");}
                else if(data.Data.qtype==5){typeNum=5;oriword="我也来评论电影";$("#typeName").html("电影评论");}
                else if(data.Data.qtype==6){typeNum=6;oriword="我也来介绍工作";$("#typeName").html("工作介绍");}
                else if(data.Data.qtype==7){typeNum=7;oriword="我也来租房买房";$("#typeName").html("租房买房");}
                else if(data.Data.qtype==8){typeNum=8;$("#typeName").html("项目资源");}
                else if(data.Data.qtype==9){typeNum=9;$("#typeName").html("人脉资源");}
                else if(data.Data.qtype==10){typeNum=10;$("#typeName").html("其他资源");}
                if(data.Data.title){
                    exptitle=data.Data.title;
                    sharetitle=data.Data.title;
                }
                else{
                    exptitle=data.Data.content.substr(0,10);
                    sharetitle=data.Data.content.substr(0,10);
                }
                euserid=data.Data.userId;
                sharemoney=(data.Data.score)/100*0.2;//微信转发
                //单身介绍人
                if(data.Data.qtype==4&&data.Data.IntroduceUsers&&data.Data.IntroduceUsers.length>0){
                    var thisIntroRealName="";
                    if(data.Data.IntroduceUsers[0].realName){ thisIntroRealName=" ("+data.Data.IntroduceUsers[0].realName+")"}
                    $("#singleCallPeople").html("被介绍人铺路ID：<span onclick='goSinglePeople(this)' data-user='"+data.Data.IntroduceUsers[0].userId+"'>"+data.Data.IntroduceUsers[0].nick+thisIntroRealName+"</span>");
                }
                //领红包
                var redBagGetNum=0;
                if(data.Data.RegBagUsers){//领取个数
                    redBagGetNum=data.Data.RegBagUsers.length;
                    allRedBagNum=data.Data.RegBagUsers.length;
                }
                $("#redBagPeopleNum").html(redBagGetNum);

                if(data.Data.isRedbag){//展示区
                    $("#continueread a").html("领取红包,继续阅读");
                    $("#continueread p").css("display","none");
                    $("#continueread #redBagNum").css("display","block");

                    $("#rednum").html(redBagGetNum);
                    $("#paynum2").css("display","none");
                    $("#rednum2").css("display","block");
                }
                if(data.Data.redbagcount>0){//剩余个数
                    redBag=true;            //点击领红包
                    $("#redBagLastNum").html(data.Data.redbagcount);
                }else{
                    redBag=false;           //点击不能领红包
                    $("#redBagLastNum").html(0);
                    if(data.Data.isRedbag){
                        $("#continueread a").html("红包已领完,继续阅读");
                    }
                }

                //已经评价
                if(data.Data.hadcommented===true){
                    $("#evaluate").remove();
                    $("#findhelp").remove();
                }
                //提示
                if(data.Data.noticeMsg){
                    $("#showrule").html(data.Data.noticeMsg);
                }
                else{
                    $("#showrule").html("转发此经验得"+parseInt(data.Data.score)*0.2/100+"元/人/点击");
                }
                //经验类型 用于支付提醒文字
                if(data.Data.isHigh===0){isexphei="no";}
                //关键词
                if(data.Data.keyWords&&data.Data.keyWords.length>0){
                    var keywords=data.Data.keyWords;
                    sharekeyword='" 关键词:'+data.Data.keyWords;//微信转发关键词
                    $(".QuestionTopics.has_topics").append("<span>关于：</span>");
                    $(".QuestionTopics.has_topics").attr("data-keyword",data.Data.id);
                    if(keywords.match(/，/)){
                        if(keywords.match(/，/)){
                            keywords=keywords.replace(/，/g,",");
                        }
                        keywords=keywords.split(",");
                        for(var k=0;k<keywords.length;k++){
                            $(".QuestionTopics.has_topics").append("<span>"+keywords[k]+"</span>")
                        }
                    }else{
                        keywords=keywords.split(",");
                        for(var k=0;k<keywords.length;k++){
                            $(".QuestionTopics.has_topics").append("<span>"+keywords[k]+"</span>")
                        }
                    };
                    $(".QuestionTopics.has_topics").append("<span>"+oriword+"</span>");
                };
                //修改标题 转发
                if(data.Data.title){
                    $("title").html(sharenick+data.Data.title+sharekeyword);
                }else{
                    var len=parseInt(data.Data.content.length*0.2)+1;
                    if(len<10){len=10};
                    var contentTitle=(data.Data.content).substring(0,len);
                    $("title").html(sharenick+contentTitle+sharekeyword);
                }
                //定位
                if(data.Data.location&&data.Data.location.length>0){
                    $(".locationplace").css("display","block");
                    $(".locationplace span").html(data.Data.location);
                };
                //相关链接
                if(data.Data.relateUrl&&data.Data.relateUrl.length>0){
                    $(".relaurl").css("display","block");
                    $(".relaurl a").html(data.Data.relateUrl);
                }
                //付费数
                var paynum=0;
                if(data.Data.PayedUsers){paynum=data.Data.PayedUsers.length}
                if(paynum>0){
                    $("#paynum2").attr("class","canclick");
                    $("#paynum").html(paynum);
                }else{
                    $("#paynum").html(0);
                }
                //点赞数
                var upnum=0;
                if(data.Data.ExpUpUsers){upnum=data.Data.ExpUpUsers.length}
                if(upnum>0){
                    for(var i=0;i<upnum;i++){
                        upnick.push(data.Data.ExpUpUsers[i].nick);
                        upuserid.push(data.Data.ExpUpUsers[i].userId);
                    }
                    showuper(upnick,upuserid);

                    //var inum=upnum;
                    //var lastword="";
                    //if(upnum>3){inum=3;lastword="等"};
                    //
                    //for(var i=0;i<upnum;i++){
                    //    if(data.Data.ExpUpUsers[i].userId==sendid){
                    //        $("#goodbtn").css("backgroundImage","url(img/redheart.png)");
                    //
                    //        $("#goodbtn .word").attr("class","word clicked");
                    //    }
                    //    if(i<inum){upnick.push(data.Data.ExpUpUsers[i].nick);}
                    //}
                    //var allupnick=upnick.join(",")+lastword;
                    //$("#upnum2").html(allupnick);
                    //$("#upnum").html(upnum);
                }else{
                    $(".allupers").css("display","none");
                    $("#upnum").html(0);
                }
                //评论数-->付费数
                //$("#browsenum").html(data.Data.answerCount);
                $("#browsenum").html(paynum);
                //评价上方数量
                $(".evaluatenum").html("("+data.Data.answerCount+")");
                //总评分
                $("#allscorenum").html(data.Data.starScore);
                //预期总输入
                expamount=parseInt(data.Data.totalamount)/100;
                //付款更新数据参数
                if(data.Data.isHigh==1){isH=true;}
                expUID=data.Data.userId;
                if((sendid==data.Data.userId)&&data.Data.isHigh==1){
                    if(parseFloat(data.Data.totalIncome)>parseFloat(data.Data.totalamount)){
                        $("#myexpword").css("display","inline-block");
                        $("#myexpword").html("已达到预期上限"+parseInt(data.Data.totalamount)/100+"元");
                    }
                }
                var lastimg="";
                //图片
                if(data.Data.imgList&&data.Data.imgList.length>0){
                    lastimg="&nbsp;&nbsp;"+data.Data.imgList.length+"张图片";
                    imgword=data.Data.imgList;
                    var showimgwidth=$(".qimgs .imgbox").width();
                    $(".qimgs .imgbox").height("auto");
                };
                //剩余字数提醒 data.Data.isconvert
                var lastwordlength=parseInt(data.Data.content.length);
                if(data.Data.isconvert===1){
                    convert="yes";//是问题转换
                    if(data.Data.title){lastwordlength=parseInt(data.Data.content.length)+parseInt(data.Data.title.length);}
                    else{lastwordlength=parseInt(data.Data.content.length)}
                }
                //$("#showlastword").html("全文"+lastwordlength+"字&nbsp;&nbsp;"+lastimg);
                //保存内容信息 直接进入 付款 20%展示
                var newword=data.Data.content;
                contnetword=data.Data.content;//重复 其他方法中的参数
                if(data.Data.isconvert==1){
                    convert="yes";//是问题转换
                    if(data.Data.title&&data.Data.isEdited!=1){
                        //newword=data.Data.title+"<br>"+data.Data.content;
                        //contnetword=data.Data.title+"<br>"+data.Data.content;
                        newword=data.Data.content;
                        contnetword=data.Data.content;
                    }
                    else{
                        newword=data.Data.content;
                        contnetword=data.Data.content;
                    }
                }
                //总收入
                $("#allgetmoney").html(parseFloat(data.Data.totalIncome)/100);
                allmoney=parseFloat(data.Data.totalIncome)/100;
                //展示付款用户
                if(data.Data.PayedUsers){
                    //$(".showpaypeople").css("display","block");
                    var len=data.Data.PayedUsers.length;
                    if(data.Data.PayedUsers.length>16){
                        len=16;
                    }
                    for(var i=0;i<len;i++){
                        var payimg="<img src='img/af8.png'/>";
                        if(data.Data.PayedUsers[i].headImg){
                            payimg="<img src='"+imgurl+data.Data.PayedUsers[i].headImg+"' onload='showloadimg(this)' style='display:none;'/>"
                        }
                        $(".showpaypeople .imgbody").append("<div style='width:"+imgwid+"px;height:"+imgwid+"px'><a onclick='gotoother(this)' data-href='otherpeoplepage.html?otherid="+data.Data.PayedUsers[i].userId+"'>"+payimg+"</a></div>");
                    }
                }else{
                    //$(".showpaypeople").css("display","none")
                }
                //单价
                if(data.Data.isRedbag){
                    $(".senderinfo .lf span").html(parseFloat(data.Data.RedBagScore)/100+"红包");//经验有多少钱
                }else{
                    $(".senderinfo .lf span").html(parseFloat(data.Data.score)/100);//经验有多少钱
                }
                expprice=parseFloat(data.Data.score)/100;
                $(".payscore2").html(parseFloat(data.Data.score)/100);
                $("#heightexpscore").html(parseFloat(data.Data.score)/100);
                //保存单价金额
                money=parseFloat(data.Data.score);
                //评星
                var starlen=0;
                if(data.Data.starScore!==0){
                    var strnum=(data.Data.starScore).toString();
                    if(strnum.length===3){
                        var lastnum=parseFloat(strnum.substring(strnum.length-1));
                        //尾数在4~6之间
                        if(lastnum>=4&&lastnum<=6){
                            starlen=strnum.substring(strnum.length-1,0)+5;
                        }else if(lastnum<4){
                            starlen=strnum.substring(0,1);
                        }else if(lastnum>6){
                            starlen=parseFloat(strnum.substring(0,1))+1;
                        }
                    }else{
                        starlen=data.Data.starScore;
                    }
                };
                $("#detailstar #expstar").css("width",parseFloat(starlen)*20+"%");
                //匿名
                var detailRealName="";
                if(data.Data.realName){detailRealName=" ("+data.Data.realName+")"}
                //if(data.Data.isHideName==1){
                //    $(".senderinfo .rt #sendernick").append("<a>匿名</a>");
                //}else{
                //    if($.cookie("MYID")){
                //        //(已赚"+(data.Data.userEarnScore)/100+"元)
                //        $(".senderinfo .rt #sendernick").append("<a class='canclick' href='otherpeoplepage.html?otherid="+data.Data.userId+"'>"+data.Data.userNick+detailRealName+"</a>");
                //    }
                //    else{
                //        //(已赚"+(data.Data.userEarnScore)/100+"元)
                //        $(".senderinfo .rt #sendernick").append("<a>"+data.Data.userNick+detailRealName+"</a>");
                //    }
                //};
                var fromLevelWord="";
                if(data.Data.Mlevel==3||data.Data.Tlevel==3){
                    fromLevelWord="来自高层"
                }else if(data.Data.Mlevel==2||data.Data.Tlevel==2){
                    fromLevelWord="来自同层"
                }else if(data.Data.Mlevel===1||data.Data.Tlevel===1){
                    fromLevelWord="来自普通层"
                }
                if(data.Data.userId== $.cookie("MYID")){fromLevelWord="来自自己"}
                $(".senderinfo .rt #sendernick").append("<a class='canclick' onclick='usergohref(this)' data-href='otherpeoplepage.html?otherid="+data.Data.userId+"'>"+fromLevelWord+"</a>");
                //时间
                var sendtime="";
                if(data.Data.cTime){
                    sendtime=getDateDiff(getDateTimeStamp(data.Data.cTime));
                    if(sendtime&&sendtime.length>0){
                        $(".senderinfo .rt #sendertime").html(sendtime);
                    }else{
                        $(".senderinfo .rt #sendertime").html("刚刚");
                    }
                    //console.log(sendtime);
                };
                //标题
                $("#sharetitleword div").html(data.Data.title);

                $("#modalscore").html(data.Data.score);
                //展示20% 展示全部判断 如果有ID 不是转发直接进入
                if($.cookie("MYID")){
                    //进行付费判断 是不是自己的经验
                    if(euserid!=id){
                        //判断有没有付完款data.Data.message
                        if(data.Data.PayMessage=="自己的经验"
                            ||data.Data.PayMessage=="已付费"
                            ||($.cookie("pexpid")===eid&&$.cookie("pexpuid")==id)
                            ||data.Data.RedbagMessage=="已经领取红包"){
                            //#qrcode{right:81px;}
                            $("#singleCallPeople").css("display","block");
                            //投诉
                            $("#Complaint").css("display","block");
                            //修改页面滚动
                            $("#qrcode").css("right","81px");
                            $("#givechat").css("display","block");
                            $("#givechat2").css("display","block");
                            $(".comAndUp").css("display","block");
                            var facecode=codetoface(newword);
                            $(".getcontent").html(facecode);
                            $("#continueread").css("display","none");
                            $("#qimgsplace").css("display","block");
                            //$("#findhelp").css("display","block");//评价
                            //$("#evaluate").css("display","block");
                            if(imgword){
                                for(var r=0;r<imgword.length;r++){
                                    $("#qimgsplace").append("<div class='imgbox contentImg'><img src='http://42.62.66.198:8003/"+imgword[r].imgPath+"' onload='contentshowloadimg(this)' style='opacity:0;'/></div>");
                                }
                            }
                            //控制 是否展示全部 来自expfromsharelink.js
                            showall="yes";
                        }
                        else{
                            //console.log("不能看");
                            if(data.Data.PayMessage=="积分余额不足"){
                                havemoney="no";
                            }
                            if(data.Data.PayMessage!="未付费"&&data.Data.PayMessage!="免费经验"){
                                canpayexp="no";
                            }else{
                                canpayexp="yes";
                            }
                            //没付费 展示20%;
                            $("#continueread").css("display","block");
                            $("#qimgsplace").css("display","none");
                            if(data.Data.isconvert==1&&data.Data.title){//修改经验没有标题
                                convertTitle=data.Data.title;
                                convertContent=data.Data.content;
                                convert="yes";//是问题转换
                                var facecode=codetoface(data.Data.title);
                                $(".getcontent").html(data.Data.title);
                            }else{
                                var len=parseInt(newword.length*0.2)+1;
                                if(len<10){len=10};
                                newword=(newword).substring(0,len);
                                var facecode=codetoface(newword);
                                $(".getcontent").html(facecode+"（全文"+lastwordlength+"字"+lastimg+"）");
                            }
                            //canpayexp="yes";
                        }
                    }
                    //是自己的经验 直接全部展示
                    else{
                        $("#singleCallPeople").css("display","block");
                        var facecode=codetoface(contnetword);
                        $(".getcontent").html(facecode);
                        $("#continueread").css("display","none");
                        $("#qimgsplace").css("display","block");
                        //$("#findhelp").css("display","block");//评价
                        //$("#evaluate").css("display","block");
                        //修改页面滚动
                        $("#qrcode").css("right","81px");
                        $("#givechat").css("display","block");//导航评价
                        $("#givechat2").css("display","block");
                        $(".comAndUp").css("display","block");
                        if(imgword){
                            for(var r=0;r<imgword.length;r++){
                                $("#qimgsplace").append("<div class='imgbox contentImg'><img src='http://42.62.66.198:8003/"+imgword[r].imgPath+"' onload='contentshowloadimg(this)' style='opacity:0;'/></div>");
                            }
                        }
                        //控制 是否展示全部 来自expfromsharelink.js
                        showall="yes";
                        //高额经验 禁止修改
                        if(data.Data.isHigh===1){
                            $("#changeexp").css("display","none");
                        }else{
                            $("#changeexp").css("display","block");
                        }
                    }
                }
                //没有用户ID 展示20%
                else{
                    $("#continueread").css("display","block");
                    $("#qimgsplace").css("display","none");
                    if(convert=="yes"){
                        var facecode=codetoface(data.Data.title);
                        $(".getcontent").html(data.Data.title);
                    }else{
                        var newword=data.Data.content;
                        var len=parseInt(newword.length*0.2)+1;
                        if(len<10){len=10};
                        newword=(newword).substring(0,len);
                        var facecode=codetoface(newword);
                        $(".getcontent").html(facecode+"（全文"+lastwordlength+"字&nbsp;&nbsp;"+lastimg+"）");
                    }
                }
                //第一次加载展示评价标签
                if(data.Data.exStarList&&data.Data.exStarList.length>0){
                    $("#noticeevalu").css("display","block");
                    //$("#noticeevalu .noticebox").css("display","block");
                    //for(var a=0;a<data.Data.exStarList.length;a++){
                    //    $("#noticeevalu .noticebox").append("<div class='item'>"+starhash[data.Data.exStarList[a].labelId]+"("+data.Data.exStarList[a].count+")</div>");
                    //}
                }else{
                    //$("#noticeevalu .noticebox").css("display","none");
                }
                //前五条相关经验
                relevantnews(1);
                //微信分享
                if(is_weixn()){wxshare()};
            }
        }
    });
    //付款完成 展示页面
    function showPage(){
        $("#singleCallPeople").css("display","block");
        //修改页面滚动
        $("#qrcode").css("right","81px");
        $("#givechat").css("display","block");//导航评价
        $("#givechat2").css("display","block");
        $(".comAndUp").css("display","block");
        //投诉
        $("#Complaint").css("display","block");
        if($("#paynum").html()){$("#paynum").html(parseInt($("#paynum").html())+1);}
        else{$("#paynum").html(1);}
        $("#paynum2").attr("class","canclick");
        //插入付费头像
        if($(".imgbody>div").length==16){$(".imgbody>div:last").remove();}
        $(".showpaypeople .imgbody").prepend("<div style='width:"+imgwid+"px'><a href='setpage.html'>"+myimg+"</a></div>");
        paymoney="yes";
        //重新替换 //是问题转换
        if(convert==="yes"){
            var facecode=codetoface(contnetword);
            $(".getcontent").html(facecode);
        }else{
            var facecode=codetoface(contnetword);
            $(".getcontent").html(facecode);
        };
        //保存已付款经验ID 返回
        $.cookie("pexpid",eid);
        $.cookie("pexpuid",id);
        $("#continueread").css("display","none");
        $("#qimgsplace").css("display","block");
        if(imgword){
            for(var r=0;r<imgword.length;r++){
                $("#qimgsplace").append("<div class='imgbox contentImg'><img src='http://42.62.66.198:8003/"+imgword[r].imgPath+"' onload='contentshowloadimg(this)' style='opacity:0;'/></div>");
            }
        }
        var newmoney=parseFloat(money)/100+parseFloat(allmoney);
        $("#allgetmoney").html(newmoney);
        if(expUID==id&&isH){
            $("#myexpword").css("display","inline-block");
            if(newmoney>expamount){$("#myexpword").html("已达到预期上限"+expamount+"元")};
        }
        //控制 是否展示全部 来自expfromsharelink.js
        showall="yes";
    }
    //点击付款 普通经验加载全部 高额弹出付款提醒
    $("#continueread a").click(function(){
        var shareuser="";
        //点击进入
        if($.cookie("shareUserId")){
            shareuser=$.cookie("shareUserId");
        }
        //是不是转发进来的 有没有ID
        if(id){
            //console.log(canpayexp);
            if(canpayexp==="yes"){ //能不能付款 （转发进入 未知错误）
                if(isexphei==="yes"){ //是不是高额经验 直接展开还是有弹窗
                    $("#heightexpdiv").css("display","block");
                }
                else if(isexphei==="no"){
                    var fromuser=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];
                    if(/[0-9]/.test($.cookie("MYID"))&&$.cookie("MYID")!=fromuser){
                        shareuser=fromuser;
                    }
                    if(/[0-9]/.test($.cookie("MYID"))){id=$.cookie("MYID")};
                    if(canpayclick){
                        canpayclick=false;//按钮不能点击
                        if(redBag){   //领红包
                            $.ajax({
                                type:"post",
                                url:getRedBagUrl,
                                data:{"userId":id,"questionId":eid},
                                success:function(data){
                                    console.log(data);
                                    if(data.Data=="无红包或者红包已经领完"){
                                        $("#rednum").html(allRedBagNum);
                                    }else{
                                        $("#rednum").html(parseInt($("#rednum").html())+1);
                                    }
                                    showPage();
                                }
                            })
                        }else{        //直接付款
                            $.ajax({
                                type:"post",
                                datatype:"json",
                                url:payexpurl,
                                data:{"quserId":euserid,"contentId":eid,"userId":id,"score":parseFloat(money),"shareUserId":shareuser},
                                success:function(d){
                                    console.log(d);
                                    if(d.Code==="TRUE"){
                                        //展示页面
                                        showPage();
                                    }else{
                                        $("#nomoneyalert").css("display","block");
                                    }
                                }
                            });
                        }
                    }

                }
            }
            //不能付费
            else if(canpayexp==="no"){
                if(havemoney==="no"){$("#nomoneyalert").css("display","block");}
                else{
                    if($.cookie("MYID")){alert("支付失败")}
                }
            }
        }
        //点击直接跳转注册
        else{
            var newid=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];
            location.href="http://www.pulu.com/weixin/index.html?eid="+eid+"&fromuser="+newid;
        }
    });
    $("#nomoneyok").click(function(){
        $("#nomoneyalert").css("display","none");
    });
    //高额弹出付款
    $("#heightexpok").click(function(){
        var shareuser="";
        //点击进入
        if($.cookie("shareUserId")){
            shareuser=$.cookie("shareUserId");
        }
        //外部分享进入 级别最高 替换所有
        //if($.cookie("fromuser")){
        //    if($.cookie("fromuser")!=id){
        //        shareuser=$.cookie("fromuser");
        //    }
        //}
        //alert("2."+shareuser+"-----cookie:"+$.cookie("shareUserId")+":"+$.cookie("MYID"));
        var fromuser=(location.href).match(/fromuser=[0-9a-z]+/)[0].split("=")[1];
        if(/[0-9]/.test($.cookie("MYID"))&&$.cookie("MYID")!=fromuser){
            shareuser=fromuser;
        }
        if(/[0-9]/.test($.cookie("MYID"))){id=$.cookie("MYID")};
        if(canpayclick){
            canpayclick=false;//按钮不能点击
            $.ajax({
                type:"post",
                datatype:"json",
                url:payexpurl,
                data:{"quserId":euserid,"contentId":eid,"userId":id,"score":parseFloat(money),"shareUserId":shareuser},
                success:function(d){
                    console.log(d);
                    if(d.Message==="本次成功付费"||d.Message==="不用付费"){
                        //修改页面滚动
                        $("#qrcode").css("right","81px");
                        $("#givechat").css("display","block");//导航评价
                        $("#givechat2").css("display","block");
                        $(".comAndUp").css("display","block");
                        //投诉
                        $("#Complaint").css("display","block");
                        //$(".showpaypeople").css("display","block");
                        if($("#paynum").html()){
                            $("#paynum").html(parseInt($("#paynum").html())+1);
                        }
                        else{
                            $("#paynum").html(1);
                        }
                        //$("#paynum2").css("display","inline-block");
                        $("#paynum2").attr("class","canclick");
                        //插入付费头像
                        if($(".imgbody>div").length==16){
                            $(".imgbody>div:last").remove();
                        }
                        $(".showpaypeople .imgbody").prepend("<div style='width:"+imgwid+"px'><a href='setpage.html'>"+myimg+"</a></div>");
                        paymoney="yes";
                        //重新替换 //是问题转换
                        if(convert==="yes"){
                            //var facecode=codetoface(convertTitle+convertContent);
                            var facecode=codetoface(contnetword);
                            //var facecode=codetoface(convertContent);
                            $(".getcontent").html(facecode);
                        }else{
                            var facecode=codetoface(contnetword);
                            $(".getcontent").html(facecode);
                        };
                        //保存已付款经验ID 返回
                        $.cookie("pexpid",eid);
                        $.cookie("pexpuid",id);
                        $("#continueread").css("display","none");
                        $("#qimgsplace").css("display","block");
                        //$("#findhelp").css("display","block");//评价
                        //$("#evaluate").css("display","block");
                        if(imgword){
                            for(var r=0;r<imgword.length;r++){
                                $("#qimgsplace").append("<div class='imgbox contentImg'><img src='http://42.62.66.198:8003/"+imgword[r].imgPath+"' onload='contentshowloadimg(this)' style='opacity:0;'/></div>");
                            }
                        }
                        var newmoney=parseFloat(money)/100+parseFloat(allmoney);
                        $("#allgetmoney").html(newmoney);
                        if(expUID==id&&isH){
                            $("#myexpword").css("display","inline-block");
                            if(newmoney>expamount){$("#myexpword").html("已达到预期上限"+expamount+"元")};
                        }
                        //控制 是否展示全部 来自expfromsharelink.js
                        showall="yes";
                        //关闭弹窗
                        $("#heightexpdiv").css("display"," none");
                        //付款成功 证明账号存在可用 清除所有分享数据
                        $.cookie("shareUserId","");
                        $.cookie("fromuser","");
                    }else{
                        console.log("付款失败");
                    }
                }
            });
        }

    });
    //获得回答
    getanswer(3,"main");
    //编辑修改经验跳转
    $("#changeexp").click(function(){
        if(euserid===id){
            //$.cookie("changeQue","que")//区分当前是否为问题
            $.cookie("changeQue","");
            if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
                modalbg1.className+=' animate_out';
                modal1.className+=' animate_out';
            }
            timer1=setTimeout(changeclass1,100);
            location.href="changeexp.html?id="+id+"&eid="+eid;
            //if(is_weixn()){
            //    location.href="https://www.pulu.com/weixin/changeexp.html?eid="+eid;
            //}else{
            //    location.href="https://www.pulu.com/changeexp.html?id="+id+"&eid="+eid;
            //}
        }
    });
    //获得相关经验
    function relevantnews(currentIndex){
        $.ajax({
            type:"get",
            datatype:"json",
            url:relevantexpurl+id+"&currentIndex="+currentIndex+"&pageSize=5&questionId="+eid+"&qtype="+typeNum,
            success:function(d){
                //console.log("相关经验");
                //console.log(d);
                if(d.Data&&d.Data.length>0){
                    for(var i=0;i<d.Data.length;i++){
                        $("#Relevantexp").append("<li class='Cell'><a class='tc_inner' style='overflow:hidden;' onclick='moneytest(this)' data-isheight='"+d.Data[i].isHigh+"' data-score="+d.Data[i].score+" data-eid="+d.Data[i].id+" data-euser="+d.Data[i].questionUserId+"><span class='tc_text'>"+d.Data[i].title+"</span><span class='rt' style='padding-left:16px;padding-right:20px;'>"+(parseFloat(d.Data[i].score)/100)+"</span></a><div class='tc_discl'></div><div class='tc_stroke'></div></li>")
                    }
                    if(d.Data.length<5){
                        $("#moreexp").css("display","none");
                    }else{
                        $("#moreexp").css("display","block");
                    }
                }else{
                    $("#Relevantexp").append("<li class='Cell' style='background:#fff'><a class='tc_inner' style='text-align: center;padding-left:20px;'><span class='tc_text' style='font-size:15px;color:#999;'>无相关推荐</span></a></li>");
                    $("#moreexp").css("display","none");
                }
            }
        });
    }

    //更多相关经验
    $("#moreexp").click(function(){
        if(haveMyid){
            $.ajax({
                type:"get",
                datatype:"json",
                url:relevantexpurl+id+"&currentIndex=2&pageSize=5&questionId="+eid+"&qtype=3",
                success:function(d){
                    console.log("相关经验");
                    console.log(d);
                    if(d.Data&&d.Data.length>0){
                        for(var i=0;i<d.Data.length;i++){
                            $("#Relevantexp").append("<li class='Cell'><a class='tc_inner' style='overflow:hidden;' onclick='moneytest(this)' data-score="+d.Data[i].score+" data-eid="+d.Data[i].id+" data-euser="+d.Data[i].questionUserId+"><span class='tc_text'>"+d.Data[i].title+"</span><span class='rt' style='padding-left:16px;padding-right:20px;'>"+(parseFloat(d.Data[i].score)/100)+"</span></a><div class='tc_discl'></div><div class='tc_stroke'></div></li>")
                        }
                    }else{
                        //$("#Relevantexp").append("<li class='Cell' style='background:#ECECEC'><a class='tc_inner' style='text-align: center'><span class='tc_text' style='font-size:15px;color:#999;'>无相关经验</span></a></li>");
                        $("#moreexp").css("display","none");
                    }
                }
            });
            $("#moreexp").css("display","none");
        }

    });
    //去充值
    $("#okgobtn").click(function(){
        location.href="scoredetail.html";
    })
    //不去充值
    $(".cancel3").click(function(){
        $("#waitplace").css("display","none");
        $("body").css("overflow","auto");
    });
    //提交回复评论
    $("#sendcom").click(function(){
        if(havesendcom){
            havesendcom=false;
            var comword=document.getElementById("commentinput").value;
            document.getElementById("commentinput").value="";
            var answer={};
            answer.questionId=eid;
            answer.content=comword;
            answer.answerUserId=id;
            answer.atype=3;
            answer.up=0;
            answer.down=0;
            answer.starScore=starscore;
            var labalarr=[];
            var labelids;
            if($("#goodword").css("display")==="block"){
                var goodworddiv=document.querySelectorAll("#goodword div");
                for(var i=0;i<goodworddiv.length;i++){
                    if(goodworddiv[i].className==="chicked"){
                        labalarr.push(goodworddiv[i].dataset.num);
                    }
                }
                labelids=labalarr.toString();
            }
            else if($("#badword").css("display")==="block"){
                var badworddiv=document.querySelectorAll("#badword div");
                for(var i=0;i<badworddiv.length;i++){
                    if(badworddiv[i].className==="chicked"){
                        labalarr.push(badworddiv[i].dataset.num);
                    }
                }
                labelids=labalarr.toString();
            }
            $.ajax({
                type:"post",
                datatype:"json",
                url:"https://www.pulu.com/webapi/api/PuluAnswer/AddAnswer_e",
                data:{"puluanswer":answer,"imgs":"","labelids":labelids},
                success:function(data){
                    //刷新
                    location.reload();
                    //评论数 更新
                    //$("#addmoreanswerbtn").css("display","block");
                    //var a=($(".evaluatenum").html()).match(/[0-9]+/)[0];
                    //var aa=parseFloat(a)+1;
                    //$(".evaluatenum").html("("+aa+")");
                    //$("#evaluate").css("display","none");
                    //$("#findhelp").css("display","none");
                    ////回顶部
                    //document.body.scrollTop=0;
                    ////var pinglun="<a class='commentbtn' onclick='comment(this)' data-eid='"+eid+"' id='c"+data.Data+"'></a>";
                    //var pinglun="<div class='useful js_hits' onclick='comment(this)' data-eid='"+eid+"' id='c"+data.Data+"'><i></i>评论<span class='js_usefull_num'></span></div>";
                    //document.getElementById("commentinput").value='';
                    //var newcontentcode=codetoface(comword);//回复文字中插入表情图片
                    //更新标签接口
                    //$.ajax({
                    //    type:"get",
                    //    url:"https://www.pulu.com/webapi/api/puluquestion/GetStarScoreById_e?questionId="+eid,
                    //    success:function(data){
                    //        console.log(data);
                    //        //评星
                    //        var starlen=0;
                    //        if(data.Data.StarScore!==0){
                    //            var strnum=(data.Data.StarScore).toString();
                    //            if(strnum.length===3){
                    //                var lastnum=parseFloat(strnum.substring(strnum.length-1));
                    //                //尾数在4~6之间
                    //                if(lastnum>=4&&lastnum<=6){
                    //                    starlen=strnum.substring(strnum.length-1,0)+5;
                    //                }else if(lastnum<4){
                    //                    starlen=strnum.substring(0,1);
                    //                }else if(lastnum>6){
                    //                    starlen=parseFloat(strnum.substring(0,1))+1;
                    //                }
                    //            }else{
                    //                starlen=data.Data.StarScore;
                    //            }
                    //        }
                    //        $("#detailstar #expstar").css("width",parseFloat(starlen)*20+"%");
                    //        $("#noticeevalu .noticebox div").remove();
                    //        for(var a=0;a<data.Data.exStarList.length;a++){
                    //            $("#noticeevalu .noticebox").append("<div class='item'>"+starhash[data.Data.exStarList[a].labelId]+"("+data.Data.exStarList[a].count+")</div>");
                    //        }
                    //    }
                    //});

                    //if(document.getElementById("QuestionMain").style.display=="none"){
                    //    document.getElementById("QuestionMain").style.display="block";
                    //    $("#noticeevalu").css("display","block");
                    //    $("#noticeevalu .noticebox").css("display","block");
                    //}
                    ////添加假数据
                    //$("#QuestionMain .othersanswer:nth-child(3)").remove();
                    //var headerimg="<img class='portrait' src='../img/af8.png'> ";
                    //if($.cookie("MYAVA")){
                    //    headerimg="<img class='portrait' src='http://42.62.66.198:8003/"+$.cookie("MYAVA")+"' onload='showloadimg(this)' style='display:none;'> ";
                    //}
                    //var paycode="<span class='star star0'><i style='width:"+parseFloat(starscore)*20+"%'></i></span>";
                    //$("#noticeevalu").after("<div class='js_tag js_commentP'><div class='common-head-view'><div class='author-logo'>"+headerimg+"</div><div class='author-info'><div class='author-info1'><div class='author js_author' style='max-width: 330px;'>"+$.cookie("MYNICK")+"</div></div><div class='author-info2'>"+""+"</div></div></div><div class='common-info'><div class='ui-comment-box ui-comment-star5'>"+paycode+"</div></div><div class='comment-main js_content'><p class='js_comment_desc'>"+newcontentcode+"</p><div class='hits_zan_box js_hits_zan_box'><div class='left-view'><p class='resource_date'>刚刚</p></div><div class='common-iconfont useful js_hits' style='display:none;''><i class='upthumlogo'></i>有用<span class='js_usefull_num'>0</span></div>"+pinglun+"</div></div></div></div>")

                    $(window).scrollTop(0);

                }
            })
            //}
        }
    });
    //提交并转发----->取消·
    $("#sendcomandother").click(function(){
        document.getElementById("comword").value='';
        $(".RequestAnswersDrawer").attr("class","RequestAnswersDrawer formone isclose");
        var showheight2=allheihgt;
        var steps2=0;
        var timer2=setInterval(function(){
            showheight2-=stepleng;
            steps2++;
            $(".RequestAnswersDrawer").css("height",showheight2+"px");
            if(steps2===10){
                clearInterval(timer2);
            }
        },20)

    });
    //付款
    $("#paymoneybtn").click(function(){
        var shareuser="";
        //点击进入
        if($.cookie("shareUserId")){
            shareuser=$.cookie("shareUserId");
        }
        //外部分享进入 级别最高 替换所有
        //if($.cookie("fromuser")){
        //    if($.cookie("fromuser")!=id){
        //        shareuser=$.cookie("fromuser");
        //    }
        //}
        //alert("3."+shareuser+"-----cookie:"+$.cookie("shareUserId")+":"+$.cookie("MYID"));
        if($("#moneyinput").val()&&!$("#moneyinput").val().match(/(\s)/)&&$("#moneyinput").val().match(/^[0-9]*$/)){
            $.ajax({
                type:"post",
                datatype:"json",
                url:payexpurl,
                data:{"quserId":euserid,"contentId":eid,"userId":id,"score":$("#moneyinput").val(),"shareUserId":shareuser},
                success:function(d){
                    console.log(d);
                    if(modalbg.style.display=="block"&&modal.style.display=="block"){
                        modalbg.className+=' animate_out';
                        modal.className+=' animate_out';
                    }
                    timer=setTimeout(changeclass,100);
                }
            })
        }
    });
    //收藏
    $("#collectit").click(function(){
        $("#sharewaiting").css("display","block");
        $.ajax({
            type:"post",
            datatype:"json",
            url:"https://www.pulu.com/webapi/api/PuluCollection/Addpulu_collection",
            data:{"contentid":eid,"userid":id,"contenttype":typeNum},
            success:function(data){
                $("#sharewaiting").css("display","none");
                $("#collectword a").html("收藏成功");
                if(data.Message=="已经存在"){
                    $("#collectword a").html("您已经收藏过");
                }
                $("#collectword").css("display","block");
                setTimeout(function(){
                    $("#collectword").css("display","none");
                },1000);
                clearTimeout();
                //console.log(data);
                if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
                    modalbg1.className+=' animate_out';
                    modal1.className+=' animate_out';
                }
                timer1=setTimeout(changeclass1,100);
            }
        })
    });
    //点赞
    $("#upexpbtn").click(function(){

        if($.cookie("MYID")){
            $.ajax({
                type:"post",
                url:upExpUrl,
                data:{"contentid":eid,"userid":sendid,"isup":1},
                success:function(d){
                    console.log(d);

                    if(d.Message=="该用户已经存在点赞"){
                        $("#collectword a").html("您已经点过赞");
                    }
                    else{
                        $("#collectword a").html("点赞成功");

                        $("#goodbtn").css("backgroundImage","url(img/redheart.png)");

                        $("#goodbtn .word").attr("class","word clicked");

                        if($.cookie("MYNICK")){
                            upnick.push($.cookie("MYNICK"));
                            upuserid.push($.cookie("MYID"));
                            showuper(upnick,upuserid);
                        }

                    }
                    if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
                        modalbg1.className+=' animate_out';
                        modal1.className+=' animate_out';
                    }
                    timer1=setTimeout(changeclass1,100);
                    $("#collectword").css("display","block");
                    setTimeout(function(){
                        $("#collectword").css("display","none");
                    },1000);
                    clearTimeout();
                }
            })
        }
        else{
            //alert("没有用户ID");
        }
    });
    //转发1
    var shareword=document.getElementById("shareword");//提示部分
    var cancelbtn=document.getElementById("cancelbtn");//取消按钮
    var commentinput=document.getElementById("commentinput");//评论输入框
    var sendcommentbtn=document.getElementById("sendcommentbtn");//确定按钮
    $("#sharebtn").click(function(){
        $.cookie("shareexpid",eid);
        if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
            modalbg1.className+=' animate_out';
            modal1.className+=' animate_out';
        }
        timer1=setTimeout(changeclass1,100);
        location.href="sendsharepage.html?type=3";
    });
    //投诉列表
    $.ajax({
        type:"get",
        url:complainttypeurl,
        success:function(d){
            console.log(d);
            $(d.Data).each(function(){
                switch(this.id){
                    case 1:$("#typeone").next().html(this.name);break;
                    case 2:$("#typetwo").next().html(this.name);break;
                    case 3:$("#typethree").next().html(this.name);break;
                    case 4:$("#typefour").next().html(this.name);break;
                    case 5:$("#typefive").next().html(this.name);break;
                    case 6:$("#typesix").next().html(this.name);break;
                    case 7:$("#typesev").next().html(this.name);break;
                    case 8:$("#typeei").next().html(this.name);break;
                }
            });
        }
    });
    //打开投诉页面
    $("#Complaint").click(function(){
        $("#Complaintdiv").css("display","block");
        $("#page_wrapper").css("display","none");
        if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
            modalbg1.className+=' animate_out';
            modal1.className+=' animate_out';
        }
        timer1=setTimeout(changeclass1,100);
    });
    //投诉返回
    $("#Complaintback").click(function(){
        $("#Complaintdiv").css("display","none");
        $("#page_wrapper").css("display","block");
    });
    //提交投诉
    $("#sendComplaint").click(function(){
        var allinput=$("#Complaintdiv").find("input");
        var cansend=false;
        var complainnum;
        for(var i=0;i<8;i++){
            if(allinput[i].checked==true){
                cansend=true;
                complainnum=parseInt(allinput[i].dataset.num);
                break;
            }
        }
        if(cansend){
            $.ajax({
                type:"post",
                url:complainturl,
                data:{"userid": $.cookie("MYID"),"qtype":typeNum,"qid":eid,"quserid":euserid,"tid":complainnum ,"tdes":$("#Complainttext").val()},
                success:function(){
                    $("#Complaintdiv").css("display","none");
                    $("#page_wrapper").css("display","block");
                    alert("投诉已成功提交！");
                }
            })
        }
    })
});
//键盘事件 搜索-------------------------------------------------------
document.onkeydown=function(event){
    var e = event || window.event || arguments.callee.caller.arguments[0];
    if(e && e.keyCode==13){ // enter 键
        var word=document.getElementById("searchinput").value;
        if(word){
            if(word.match(/^\s+$/g)){
                console.log("没有填信息")
            }else{
                location.href="searchdetail.html?searchKey="+word;
            }
        }
    }
};
//输入框点击动画
//展开表情区域
//
//
$('#commentinput').bind('input propertychange', function(a) {
    //console.log(a.target);
    var a= a.target;
    //自适应高度
    if(a.cols==0){a.cols=20}
    var col=a.cols;
    var val=a.value.length;
    var rownum=1;
    if(val>=col){
        rownum=Math.ceil(val/col);
        //console.log("rownum",rownum);
        if(rownum>=3){
            a.style.overflowY="auto";
            a.rows=3;
        }else{
            a.rows=rownum;
        }
    }
});
//$(window).scroll(function(){
//    console.log(document.body.scrollTop);
//});
//评价操作
$("#findhelp").click(function(){
    //location.href+="#evaluate";
    //$("#page_wrapper").css("display","none");
    //$("#evaluate").css("display","block");
    //------------------------
    //location.href="#evaluate";
    //history.go(-1);
    //var callbackinput=$("body")[0];
    var callbackinput=$(".QuestionPreview")[0];
    var part2=$("#QuestionMain")[0];
    var changebottom;
    if(typeof window.getComputedStyle!='undefined'){
        console.log(window.getComputedStyle(part2,null)["height"]);
        if(/[0-9]/.test(window.getComputedStyle(part2,null)["height"])){
            changebottom=parseInt(window.getComputedStyle(callbackinput,null)["height"])+parseInt(window.getComputedStyle(part2,null)["height"]);
        }
        else{changebottom=parseInt(window.getComputedStyle(callbackinput,null)["height"]);}
    }else if(callbackinput.currentStyle){
        if(/[0-9]/.test(part2.currentStyle["height"])){
            changebottom=parseInt(callbackinput.currentStyle["height"])+parseInt(part2.currentStyle["height"]);
        }
        else{changebottom=parseInt(callbackinput.currentStyle["height"]);}
    };
    console.log("上部高度："+changebottom);
    console.log("屏幕高度："+window.screen.height);
    //var scrolltop=document.body.scrollTop;
    //var scrolltop=parseFloat(changebottom)-window.screen.height;
    var scrolltop=parseFloat(changebottom)+74;
    console.log(scrolltop);
    //document.body.scrollTop=scrolltop;
    $(document).scrollTop(scrolltop);
    if(modalbg1.style.display=="block"&&modal1.style.display=="block"){
        modalbg1.className+=' animate_out';
        modal1.className+=' animate_out';
    }
    timer1=setTimeout(changeclass1,100);
});
//$("#closeevaluate").click(function(){
//    history.go(-1);
//    $("#page_wrapper").css("display","block");
//    $("#evaluate").css("display","none");
//});
//点击评分
var starscore=5;
$("#choicestar>div").click(function(e){
    var showwidth=e.target.className.match(/\d+/)[0];
    $("#choicestar>i").css("width",showwidth+"%");
    starscore=parseInt(showwidth)/20;
    if(starscore>3){
        $(".choicegood").attr("class","choicegood lf");
        $(".choicebad").attr("class","choicebad active rt");
        $("#goodword").css("display","block");
        $("#badword").css("display","none");
    }else if(starscore<=3){
        $(".choicegood").attr("class","choicegood active lf");
        $(".choicebad").attr("class","choicebad rt");
        $("#goodword").css("display","none");
        $("#badword").css("display","block");
    }
});
//选取评价操作
var gn=1;//三星以上评价个数
var bn=1;//三星以下评价个数
$("#evaluate>.choiceword>div").click(function(e){
    if($("#goodword").css("display")==="block"){
        if(e.target.className==="chicked"&&gn!=1){
            e.target.className="";
            --gn;
            console.log(gn);
        }else if(e.target.className===""){
            ++gn;
            console.log(gn);
            e.target.className="chicked";
        }
    }
    else if($("#badword").css("display")==="block"){
        if(e.target.className==="chicked"&&bn!=1){
            e.target.className="";
            --bn;
        }else if(e.target.className===""){
            ++bn;
            e.target.className="chicked";
        }
    }
});
//手机返回
//if( ("onhashchange" in window) && ((typeof document.documentMode==="undefined") || document.documentMode==8)) {
////浏览器支持onhashchange事件
//    window.onhashchange = hashChangeFire;
//    //对应新的hash执行的操作函数
//} else { // 不支持则用定时器检测的办法
//    setInterval(function() {
//        var ischanged = isHashChanged(); //检测hash值或其中某一段是否更改的函数
//        if(ischanged) {
//            hashChangeFire(); //对应新的hash执行的操作函数
//        }
//    }, 150);
//}
//function hashChangeFire(){
//    if(!/evaluate/.test(location.href)){
//        //将好友列表关闭展示原页面
//        $("#page_wrapper").css("display","block");
//        $("#evaluate").css("display","none");
//    }
//}
//-------------------
$("#facebtn").click(function(){
    if(/noclick/.test($("#facebtn").attr("class"))){
        allheihgt=405;
        stepleng=allheihgt/10;
        $("#facebtn").attr("class","isclick");
        $(".RequestAnswersDrawer").css("height",allheihgt+"px");
        $("#facelist").css("display","block");
    }
    else if(/isclick/.test($("#facebtn").attr("class"))){
        allheihgt=230;
        stepleng=allheihgt/10;
        $("#facebtn").attr("class","noclick");
        $(".RequestAnswersDrawer").css("height",allheihgt+"px");
        $("#facelist").css("display","none");
    }
});
//插入表情字符
function sendface(e){
    var face=e.dataset.key;
    document.getElementById("comword").value+=face;
}
function sendface2(e){
    var face=e.dataset.key;
    document.getElementById("commentinput").value+=face;
}
//转发点开表情操作
var mySwiper2;
$("#facebtn2").click(function(){
    if($("#facelist2").css("display")==="block"){
        $("#facelist2").css("display","none");
    }else{
        $("#facelist2").css("display","block");
        if(!mySwiper2){
            mySwiper2 = new Swiper ('#facelist2 .swiper-container', {
                paginationClickable: true,
                touchRatio : 1,
                initialSlide :0,
                pagination: '#facelist2 .swiper-pagination'
            })
        }
    }
});